//
// Created by hsx on 2025/4/14.
//

#ifndef BZXYD_CONNECT_MANAGER_H
#define BZXYD_CONNECT_MANAGER_H

#include "string"
#include "cstdlib"
#include "gazella/interface_timer.h"
#include "gazella/udp_server.h"
#include "gazella/udp_client.h"
#include <chrono>
#include <thread>
#include "daf/DeviceAgentModel.pb.h"
#include "daf/daf_model.h"
#include "gazella/logger.h"

class ConnectManager {
public:
    static ConnectManager* getInstance();
    bool initUdp();
    const std::string remoteAddr = "192.168.2.88";//旋翼弹NX地址;
    Gazella::UdpClient AutoCmdClient;
    const int AutoCmdPort = 37777;//端口
    Gazella::UdpServer agentServer;
    const std::string localAddr="0.0.0.0";//监听本地所有ip段
    const int localReportPort = 38888;//监听NX上报数据
    void parseReport(const std::string &remote_host, int remote_port, std::string &msg);
private:
    ConnectManager() = default;
    ~ConnectManager() = default;

};

#endif //BZXYD_CONNECT_MANAGER_H
